// 关于 用户 的路由

const express = require('express');

const router = express.Router();

// 执行函数
const articleHandler = require('../router_handler/article_handler');
const {addArticle_schema,my_articleDetail_schema,update_Article_schema} = require('../schema/article_schema')
// 数据校验
const expressJoi = require('@escook/express-joi');

// router.get('/article' ,expressJoi(articlePage_schema),articleHandler.getArticlePage);

const {validateRequest} = require('../utils/schema')

router.post('/article' ,expressJoi(addArticle_schema),articleHandler.addArticle);

router.get('/article/:id' ,expressJoi(my_articleDetail_schema),articleHandler.myArticleDetail);
router.put('/article' ,expressJoi(update_Article_schema),articleHandler.updateArticle);

router.delete('/article/:id' ,expressJoi(my_articleDetail_schema),articleHandler.deleterticle);


// 导出路由
module.exports = router;